#pragma once

#include <sys_reg.h>

typedef enum {
	DMA0_Q = 0x40020000,
	DMA1_Q = 0x40020400,
} dma_qe;

typedef enum {
	DMA_INTF_R = 0x0,
	DMA_INTC_R = 0x4,
} dma_re;

static inline u32_s dma_get_reg_q(dma_qe dma_q, dma_re dma_r) {
	return dma_q + dma_r;
}

static inline void dma_wreg(dma_qe dma_q, dma_re dma_r, u32_s value) {
	u32_s reg_q = dma_get_reg_q(dma_q, dma_r);
	wreg(reg_q, value);
}

static inline u32_s dma_rreg(dma_qe dma_q, dma_re dma_r) {
	u32_s reg_q = dma_get_reg_q(dma_q, dma_r);
	return rreg(reg_q);
}
